import os


def get_dir_size(dir_path, size=0):
    for root, dirs, files in os.walk(dir_path):
        for f in files:
            size += os.path.getsize(os.path.join(root, f))
    return size


if __name__ == '__main__':
    print(str(get_dir_size('H:/拉勾网')) + "字节")
